package com.atguigu.gmall.payment.service;

import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.model.payment.PaymentInfo;

import java.util.HashMap;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/9/5 15:08
 * @Version 1.0
 */
public interface PaymentService {

    //  保存交易记录，将数据信息保存到表中.
    /*
    create table payment_info(
        orderId
        outTradeNo --> orderDetail
        amount
        userId
        paymentStatus
    );
     */

    void savePaymentInfo(OrderInfo orderInfo,String paymentType);

    /**
     * 获取交易记录对象
     * @param outTradeNo
     * @param paymentType
     * @return
     */
    PaymentInfo getPaymentInfo(String outTradeNo, String paymentType);

    /**
     * 修改交易记录状态.
     * @param outTradeNo
     * @param paymentType
     * @param paramsMap
     */
    void updatePaymentInfoStatus(String outTradeNo, String paymentType, HashMap<String, String> paramsMap);

    /**
     * 修改订单状态。
     * @param outTradeNo
     * @param paymentType
     * @param paymentInfo
     */
    void updatePaymentInfoStatus(String outTradeNo, String paymentType, PaymentInfo paymentInfo);

    /**
     * 关闭交易记录
     * @param orderId
     */
    void closePayment(Long orderId);
}
